<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function num(a, b, c) {
            var arr2 = [a, b, c];
            for (i = 0; i < arr2.length; i++) {
                console.log(arr2[i]);
                var min = a;
                if (b < min) {
                    min = b;
                }
                if (c < min) {
                    min = c
                }
                var max = a;
                if (b > max) {
                    max = b;
                }
                if (c > max) {
                    max = c;
                }
                var mid;
                if (min < a && a < max) {
                    mid = a;
                }
                if (min < b && b < max) {
                    mid = b;
                }
                if (min < c && c < max) {
                    mid = c;
                }
            }
            console.log(`最小值是${min},中间值是${mid},最大值是${max}`);
        }
        num(2, 1, 3);
    </script>
</body>

</html>